﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Event_SG_EWDT
{
    public partial class dummy_testing_yh : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

 
        protected void btnUpload_Click(object sender, EventArgs e)
        {
            //Utility.UploadFile(Server, FileUpload1, "0001");

            Utility.UploadEventPoster(Server, FileUpload1, "0001");
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            //TextBox1.Text = TextBox1.Text.GetHashCode().ToString();

           // Utility.Email(" ");
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            //string p = Utility.GetEventPosterPath(Server, "0001");

            Image1.ImageUrl = "~/0001/poster.jpg";

            //Image1.DataBind();

            
        }

        protected void TextBox2_TextChanged(object sender, EventArgs e)
        {

        }

        protected void Button3_Click(object sender, EventArgs e)
        {
            DateTime d = DateTime.Now;

            string mod = "";
            int hr = d.Hour;

            int min = d.Minute;
            string m = d.Minute.ToString();

            if(d.Hour < 12)
            {
                mod = "AM";
            }
            else
            {
                mod = "PM";
                hr -= 12;
            }

            if (min < 10)
            {
                m = "0" + min.ToString();
            }

            ((TextBox)CustomTimePicker1.FindControl("tbxHour")).Text = hr.ToString();

            ((TextBox)CustomTimePicker1.FindControl("tbxMinute")).Text = m.ToString();

            ((TextBox)CustomTimePicker1.FindControl("tbxAMPM")).Text = mod;

        }


    }
}